/**
 * 
 */
package com.an.redisl;

import java.io.IOException;
import java.util.Map;

import com.an.json.PhoneNumber;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * @author Administrator
 *
 */
public class test211 {

	/**
	 * @param args
	 */
	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		PhoneNumber phoneNumber = new PhoneNumber();
		ObjectMapper objectMapper = new ObjectMapper();
		// json字符串为非双引号
		// json字符串中可以有vo中没有的字段
		objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
		Map<String, String> map;
		try {
			map = objectMapper.readValue(objectMapper.writeValueAsString(phoneNumber), Map.class);
			// 剔除两个不必要的键值对
			System.out.println("map.size()" + map.size());
			System.out.println("map:" + map);
			map.remove("binding");
			map.remove("axbBindingPhoneNumberMap");
			System.out.println("map:" + map);
			
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
